b5f3398c7c72a883b3830eb7a3bb1aa104d9ed62,opennms-webapp/src/main/java/org/opennms/web/controller/ksc/FormProcMainController.java,FormProcMainController,handleRequestInternal,#HttpServletRequest#HttpServletResponse#,50
Before Change
throw new MissingParameterException("report_action");
}
if ((report_action.equals("Customize")) || (report_action.equals("View")) || (report_action.equals("CreateFrom")) || (report_action.equals("Delete"))) {
String r_index = request.getParameter("report");
if (r_index == null) {
throw new MissingParameterException("report");
}
report_index = WebSecurityUtils.safeParseInt(r_index);
if ((report_action.equals("Customize")) || (report_action.equals("CreateFrom"))) {
// Go ahead and tell report factory to put the report config into the working report area
getKscReportFactory().loadWorkingReport(report_index);
if (report_action.equals("CreateFrom")) { // Need to set index to -1 for this case to have Customizer create new report index
getKscReportFactory().setWorkingReportIndex(-1);
}
}
if (report_action.equals("Delete")) { // Take care of this case right now
getKscReportFactory().deleteReportAndSave(report_index);
}
} else {
if (report_action.equals("Create")) {
report_index = -1;
// Go ahead and tell report factory to put the report config (a blank config) into the working report area
getKscReportFactory().loadWorkingReport(report_index);
}
else {
throw new ServletException ("Invalid Parameter contents for report_action");
}
}
if (report_action.equals("View")) {
ModelAndView modelAndView = new ModelAndView("redirect:/KSC/customView.htm");
modelAndView.addObject("report", report_index);
modelAndView.addObject("type", "custom");
return modelAndView;
} else {
if ((report_action.equals("Customize")) || (report_action.equals("Create")) || (report_action.equals("CreateFrom"))) {
return new ModelAndView("redirect:/KSC/customReport.htm");
} else {
return new ModelAndView("redirect:/KSC/index.htm");
After Change
private KSC_PerformanceReportFactory m_kscReportFactory;
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
String action = request.getParameter("report_action");
if (action == null) {
throw new MissingParameterException("report_action");
}
KscReportEditor editor = KscReportEditor.getFromSession(request.getSession(), false);
if (action.equals("Customize")) {
editor.loadWorkingReport(getKscReportFactory(), getReportIndex(request));
return new ModelAndView("redirect:/KSC/customReport.htm");
} else if (action.equals("CreateFrom")) {
editor.loadWorkingReportDuplicate(getKscReportFactory(), getReportIndex(request));
return new ModelAndView("redirect:/KSC/customReport.htm");
} else if (action.equals("Delete")) {
getKscReportFactory().deleteReportAndSave(getReportIndex(request));
return new ModelAndView("redirect:/KSC/index.htm");
} else if (action.equals("Create")) {
editor.loadNewWorkingReport();
return new ModelAndView("redirect:/KSC/customReport.htm");
} else if (action.equals("View")) {
ModelAndView modelAndView = new ModelAndView("redirect:/KSC/customView.htm");
modelAndView.addObject("report", getReportIndex(request));
modelAndView.addObject("type", "custom");
return modelAndView;
} else {